/*
* Copyright (C) Microsoft. All rights reserved.  
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not 
* use this file except in compliance with the License.  You may obtain a copy 
* of the License at http://www.apache.org/licenses/LICENSE-2.0  
* 
* THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 
* WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 
* MERCHANTABLITY OR NON-INFRINGEMENT. 
*
* See the Apache License, Version 2.0 for specific language governing 
* permissions and limitations under the License.
*
*/
#pragma once

#include <baja/common.hpp>

namespace baja { namespace model {

namespace b = baja;

struct igeneric_model_observer : public baja::ibase
{
    BAJA_INTERFACE_NOTAG(igeneric_model_observer);

    virtual void onChildChanged(
        const b::uint32& typeToken,
        const b::uint32& genericIdentity
        ) = 0;

};

struct igeneric_model : public baja::ibase
{
    BAJA_INTERFACE_NOTAG(igeneric_model);

    // listeners
    virtual b::int32 addGenericObserver(
        const std::shared_ptr<igeneric_model_observer>& observer
        ) = 0;
    virtual void removeGenericObserver(
        const std::shared_ptr<igeneric_model_observer>& observer
        ) = 0;
    virtual void removeGenericObserver(
        const b::int32& cookie
        ) = 0;

    // type token
    virtual void setGenericTypeToken(
        const b::uint32& genericTypeToken
        ) = 0;
    virtual b::uint32 genericTypeToken() = 0;

    // identity
    virtual void setGenericIdentity(
        const b::uint32& genericIdentity
        ) = 0;
    virtual b::uint32 genericIdentity() = 0;

    // parent
    virtual void setGenericParent(
        const std::shared_ptr<igeneric_model>& parent
        ) = 0;
    virtual std::shared_ptr<igeneric_model> genericParent() = 0;
};

}} // baja::model